home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / gui / muibuilderv11.lha / muibuilder / mb / e / Mac2E.lha / Mac2E / Sources / doMethod.e next >
Text File  |  1994-01-29  |  714b  |  22 lines

  1. /*    This procedure was given to me by Wouter van Oortmerssen, the Amiga E author.
  2. It replaces the DoMethod() function (included in the amiga.lib library) for E users. */
  3.  
  4. PROC doMethod( obj:PTR TO object, msg:PTR TO msg )
  5.  
  6.     DEF h:PTR TO hook, o:PTR TO object, dispatcher
  7.  
  8.     IF obj
  9.         o := obj-SIZEOF object     /* instance data is to negative offset */
  10.         h := o.class
  11.         dispatcher := h.entry      /* get dispatcher from hook in iclass */
  12.         MOVEA.L h,A0
  13.         MOVEA.L msg,A1
  14.         MOVEA.L obj,A2           /* probably should use CallHookPkt, but the */
  15.         MOVEA.L dispatcher,A3    /*   original code (DoMethodA()) doesn't. */
  16.         JSR (A3)                 /* call classDispatcher() */
  17.         MOVE.L D0,o
  18.         RETURN o
  19.     ENDIF
  20.  
  21. ENDPROC NIL
  22.